#include <BleCombo.h>
#include "Print.h"

const uint8_t KEY_LEFT_CTRL = 0x80;
const uint8_t KEY_LEFT_SHIFT = 0x81;
const uint8_t KEY_LEFT_ALT = 0x82;
const uint8_t KEY_LEFT_GUI = 0x83;
const uint8_t KEY_RIGHT_CTRL = 0x84;
const uint8_t KEY_RIGHT_SHIFT = 0x85;
const uint8_t KEY_RIGHT_ALT = 0x86;
const uint8_t KEY_RIGHT_GUI = 0x87;

const uint8_t KEY_A = 0x8C;
const uint8_t KEY_B = 0x8D;
const uint8_t KEY_C = 0x8E;
const uint8_t KEY_D = 0x8F;
const uint8_t KEY_E = 0x90;
const uint8_t KEY_F = 0x91;
const uint8_t KEY_G = 0x92;
const uint8_t KEY_H = 0x93;
const uint8_t KEY_I = 0x94;
const uint8_t KEY_J = 0x95;
const uint8_t KEY_K = 0x96;
const uint8_t KEY_L = 0x97;
const uint8_t KEY_M = 0x98;
const uint8_t KEY_N = 0x99;
const uint8_t KEY_O = 0x9A;
const uint8_t KEY_P = 0x9B;
const uint8_t KEY_Q = 0x9C;
const uint8_t KEY_R = 0x9D;
const uint8_t KEY_S = 0x9E;
const uint8_t KEY_T = 0x9F;
const uint8_t KEY_U = 0xA0;
const uint8_t KEY_V = 0xA1;
const uint8_t KEY_W = 0xA2;
const uint8_t KEY_X = 0xA3;
const uint8_t KEY_Y = 0xA4;
const uint8_t KEY_Z = 0xA5;

const uint8_t KEY_1 = 0xA6;
const uint8_t KEY_2 = 0xA7;
const uint8_t KEY_3 = 0xA8;
const uint8_t KEY_4 = 0xA9;
const uint8_t KEY_5 = 0xAA;
const uint8_t KEY_6 = 0xAB;
const uint8_t KEY_7 = 0xAC;
const uint8_t KEY_8 = 0xAD;
const uint8_t KEY_9 = 0xAE;
const uint8_t KEY_0 = 0xAF;

const uint8_t KEY_RETURN = 0xB0;
const uint8_t KEY_ESC = 0xB1;
const uint8_t KEY_BACKSPACE = 0xB2;
const uint8_t KEY_TAB = 0xB3;
const uint8_t KEY_SPACE = 0xB4;
const uint8_t KEY_MINUS = 0xB5;
const uint8_t KEY_EQUAL = 0xB6;
const uint8_t KEY_BRACKET_LEFT = 0xB7;
const uint8_t KEY_BRACKET_RIGHT = 0xB8;
const uint8_t KEY_BACKSLASH = 0xB9;
const uint8_t KEY_SEMICOLON = 0xBB;
const uint8_t KEY_QUOTE = 0xBC;
const uint8_t KEY_TILDE = 0xBD;
const uint8_t KEY_COMMA = 0xBE;
const uint8_t KEY_PERIOD = 0xBF;
const uint8_t KEY_SLASH = 0xC0;
const uint8_t KEY_CAPS_LOCK = 0xC1;
const uint8_t KEY_F1 = 0xC2;
const uint8_t KEY_F2 = 0xC3;
const uint8_t KEY_F3 = 0xC4;
const uint8_t KEY_F4 = 0xC5;
const uint8_t KEY_F5 = 0xC6;
const uint8_t KEY_F6 = 0xC7;
const uint8_t KEY_F7 = 0xC8;
const uint8_t KEY_F8 = 0xC9;
const uint8_t KEY_F9 = 0xCA;
const uint8_t KEY_F10 = 0xCB;
const uint8_t KEY_F11 = 0xCC;
const uint8_t KEY_F12 = 0xCD;
const uint8_t KEY_PRINTSCREEN = 0xCE;
const uint8_t KEY_SCROLL_LOCK = 0xCF;
const uint8_t KEY_PAUSE = 0xD0;
const uint8_t KEY_INSERT = 0xD1;
const uint8_t KEY_HOME = 0xD2;
const uint8_t KEY_PAGE_UP = 0xD3;
const uint8_t KEY_DELETE = 0xD4;
const uint8_t KEY_END = 0xD5;
const uint8_t KEY_PAGE_DOWN = 0xD6;
const uint8_t KEY_RIGHT_ARROW = 0xD7;
const uint8_t KEY_LEFT_ARROW = 0xD8;
const uint8_t KEY_DOWN_ARROW = 0xD9;
const uint8_t KEY_UP_ARROW = 0xDA;
const uint8_t KEY_NUM_LOCK = 0xDB;
const uint8_t KEYPAD_DIVIDE = 0xDC;
const uint8_t KEYPAD_MULTIPLY = 0xDD;
const uint8_t KEYPAD_SUBTRACT = 0xDE;
const uint8_t KEYPAD_ADD = 0xDF;
const uint8_t KEYPAD_ENTER = 0xE0;
const uint8_t KEYPAD_1 = 0xE1;
const uint8_t KEYPAD_2 = 0xE2;
const uint8_t KEYPAD_3 = 0xE3;
const uint8_t KEYPAD_4 = 0xE4;
const uint8_t KEYPAD_5 = 0xE5;
const uint8_t KEYPAD_6 = 0xE6;
const uint8_t KEYPAD_7 = 0xE7;
const uint8_t KEYPAD_8 = 0xE8;
const uint8_t KEYPAD_9 = 0xE9;
const uint8_t KEYPAD_0 = 0xEA;
const uint8_t KEYPAD_DOT = 0xEB;
const uint8_t KEY_APPLICATION = 0xED;
const uint8_t KEY_F13 = 0xF0;
const uint8_t KEY_F14 = 0xF1;
const uint8_t KEY_F15 = 0xF2;
const uint8_t KEY_F16 = 0xF3;
const uint8_t KEY_F17 = 0xF4;
const uint8_t KEY_F18 = 0xF5;
const uint8_t KEY_F19 = 0xF6;
const uint8_t KEY_F20 = 0xF7;
const uint8_t KEY_F21 = 0xF8;
const uint8_t KEY_F22 = 0xF9;
const uint8_t KEY_F23 = 0xFA;
const uint8_t KEY_F24 = 0xFB;

class Keyboard_ : public Print
{
public:
    void begin();
    void end(void);
    size_t write(uint8_t k);
    size_t write(const MediaKeyReport m);
    size_t write(const uint8_t *buffer, size_t size);
    size_t press(uint8_t k);
    size_t press(const MediaKeyReport m);
    size_t release(uint8_t k);
    size_t release(const MediaKeyReport k);
    void releaseAll(void);
};

extern Keyboard_ Keyboard;